<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../Ajs/axios.js"></script>
</head>
<body>

<script>
    /*请求拦截器*/
    //在请求发出之前设置一些信息
    axios.interceptors.request.use(function(config){
        console.log(config.url);
        config.headers.mytoken = "nihao";

        return config;  //config必须return出去

    },function(err){   //用于处理错误信息
        console.log(err);
    });
    axios.get("../AData/data.json").then(function(data){
        console.log(data);
    })


</script>
</body>
</html>
